package com.tree.commonresultdemo.controller;

import com.tree.commonresultdemo.result.Result;
import com.tree.commonresultdemo.result.ResultUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhong
 * @version 1
 * @date 2022/04/10
 * @contact 1478168700@qq.com
 **/
@RestController
@RequestMapping("/result")
public class TestController {

    @GetMapping("/success")
    public Result<String> success() {
        return ResultUtil.success("success");
    }

    @GetMapping("/fail")
    public Result<String> fail() {
        return ResultUtil.fail("fail");
    }
}
